change so that it can receive query and body