add functions for get and post