Refactored restapi from GET to POST