Changed return values of api login to be JSON