Initial API controller, fixed entity framework

Also renamed Imagedata to ImageData in the data objects.