simplifying rest api?