add api endpoint for post resource