fix handling of post requests in api