Login api with rethinkdb