Added error message function.
Started get contents in JSON format.