added post handler for custom endpoints