finished implemting json responses for API