Better error handling. Added login method to the data source (still not working properly)