work on restful API, giving and receiving json. currently not working