Fixes #4

Minor changes to improve the way the API handles user credentials
Merged