Consolidate two dispatch functions together.
Output appropriate HTTP status when erroring.