Simplification of api handler