Updated Database Query error handling.
Add support for user profiles.
Updated test case.