Towards magnetic trapping of molecules