PHP class to use in my APIs development / htaccess to rewrite rule