Base class to create a RESTful API with php