get and post methods for api