refactor post to /:type