separate functions for get and post