added $post function for custom endpoints