cleaned code and method returns JSON on request