Added JSON api support for user authentication and registration.