Securing the api