Php implementation of a REST service which serves element json objects