Adding timeout, and jsonifying data