Fixed CORS and return correct json