Introduce rest api

opening bracket on the same if line (PSR-2 standards)