Move authentication to the client side and implement a RESTful API