API AJAX setup and file compiling database to JSON