Add tests for apiary controller and create JSON context